package ca.usask.cs.drawTree;

import java.util.LinkedList;

import ca.usask.cs.decisiontree.api.Edge;

public class DecisionNode extends TheNode {
	private DrawControler parent;
	private Edge sourceEdge;
	private double time;
	private String variableName;
	private boolean selected;
	private LinkedList<Edge> childrenEdgeList;
	private int treeNodeID;
	private Edge bestChildEdge;
	private double rollBackValue;
	private String NodeType = "DecisionNode";
	
	int nodesquareColor = 0xff006600;

	DecisionNode(DrawControler dp, float ix, float iy, float ir, int Nodetype) {

		super(dp, ix, iy, ir, Nodetype);
		parent = dp;
		// TODO Auto-generated constructor stub
	}

	public void draw(float sx, float sy, float sw) {
		parent.fill(nodesquareColor);
		parent.strokeWeight((float) 1.5);
		parent.rect(sx, sy, sw, sw);
	}
	
	public void changeColor(int color ) {
		nodesquareColor = color;
	}
	public void colorBack(){
		nodesquareColor = 0xff006600;
	}
	
	public void setSourceEdge(Edge isourceEdge){
		this.sourceEdge = isourceEdge;
	}
	public void setTime(double itime){
		this.time = itime;
	}
	public void setVariableName(String iname){
		this.variableName = iname;
	}
	public void setSelected(boolean iseleted){
		this.selected = iseleted;
	}
	public void setTreeNodeID(int iID){
		this.treeNodeID = iID;
	}
	public void setRollBackValue(double irollBackValue){
		this.rollBackValue = irollBackValue;
	}
	public void setBestChildEdge(Edge ibestChildEdge){
		this.bestChildEdge = ibestChildEdge;
	}

	
	public Edge getSourceEdge(){
		return this.sourceEdge;
	}
	public double getTime(){
		return this.time;
	}
	public String getVariableName(){
		return this.variableName;
	}
	public boolean getSelected(){
		return this.selected;
	}
	public int getTreeNodeID(){
		return this.treeNodeID;
	}
	public double getRollBackValue(){
		return this.rollBackValue;
	}
	public Edge getBestChildEdge(){
		return this.bestChildEdge;
	}
	public String getNodeType(){
		return this.NodeType;
	}

	
}
